﻿using System.Linq;
using iss.sg4210.se18.team6s.jass.DAL.DataAccess.Interfaces;
using System;

namespace iss.sg4210.se18.team6s.jass.DAL.DataAccess.MSSQL
{
    public class SearchDAO : ObjectDAO, ISearch
    {
        public IQueryable<Advertisement> GetAllSearchResults()
        {
            return jassEntities.Advertisements.Where(m => DateTime.Compare(m.StartDate, DateTime.Now) <= 0 && !m.IsDeleted && !m.IsWithDrawn && !m.IsFulFilled);
        }
    }
}
